package com.ctshk.common.enums.ship;

public enum ShipErrorCodeEnum {

    err_code00001("err_code00001","用戶為空"),
    err_code00002("err_code00002","密碼不匹配"),
    err_code00003("err_code00003","系統中無此用戶"),
    err_code00004("err_code00004","密碼為空"),
    err_code00005("err_code00005","用戶驗證失敗"),
    err_code00006("err_code00006","worksite 不能為空"),
    err_code00007("err_code00007","worksite 不存在,IP 驗證失敗"),
    err_code00008("err_code00008","discount 不適用于此 worksite"),
    err_code00009("err_code00009","此 worksite 不包含任何 discount"),
    err_code01001("err_code01001","可用航線信息為空"),
    err_code01002("err_code01002","獲取可用航線信息失敗"),
    err_code01003("err_code01003","worksite 傳遞錯誤"),
    err_code01011("err_code01011","當天未有該類型航班票務信息"),
    err_code01012("err_code01012","當天未有該類型航班票務去程信息"),
    err_code01013("err_code01013","當天未有該類型航班票務回程信息"),
    err_code01014("err_code01014","filterXml 參數為空"),
    err_code01015("err_code01015","SAILDATE 未填寫"),
    err_code01016("err_code01016","FROMPORTCODE 未填寫"),
    err_code01017("err_code01017","TOPORTCODE 未填寫"),
    err_code01019("err_code01019","discount_id 傳遞錯誤"),
    err_code01020("err_code01020","ISROUNDTRIP 未填寫"),
    err_code01021("err_code01021","LANG 未填寫"),
    err_code01022("err_code01022","filterXml 格式錯誤"),
    err_code01023("err_code01023","filterXml 资料无法获取航班票务信息"),
    err_code01024("err_code01024","獲取航班票務信息失敗"),
    err_code01051("err_code01051","ticketsInfoXML 參數為空"),
    err_code01052("err_code01052","ticketsInfoXML 格式錯誤"),
    err_code01053("err_code01053","購票訂單提交失敗"),
    err_code01055("err_code01055","機場線和市區線不能在同在訂單下購票"),
    err_code01056("err_code01056","金珠線和珠江線不能在同在訂單下購票"),
    err_code01057("err_code01057","機場線不允許應用 ETicket 售票"),
    err_code01058("err_code01058","非會員，不符合 ETicket 售票"),
    err_code01059("err_code01059","超過會員限額，不符合 ETicket 售票"),
    err_code01060("err_code01060","乘客已購票，不符合 ETicket 售票"),
    err_code01061("err_code01061","按金不足"),
    err_code01063("err_code01063","不存在此臨時用戶"),
    err_code01064("err_code01064","獲取臨時用戶失敗"),
    err_code01065("err_code01065","鎖位失敗"),
    err_code01066("err_code01066","餘票不足，無法提交訂單(航班 ID，座位等级 ID，子错误码)"),
    err_code01067("err_code01067","無法鎖位"),
    err_code01068("err_code01068","獲取交易號失敗"),
    err_code01069("err_code01069","獲取票價記錄失敗"),
    err_code01070("err_code01070","鎖位數與傳入記錄數不符"),
    err_code01071("err_code01071","獲取港口公司失敗"),
    err_code01072("err_code01072","所选座位已被占用,无法锁位"),
    err_code01073("err_code01073","释放座位失败"),
    err_code01074("err_code01074","航班日期必须大于当前时间"),
    err_code01075("err_code01075","实名制证件号格式错误，长度最多 25 位，输入的必须英文大写+数字，或者纯数字，不能有其他字符"),
    err_code01076("err_code01076","存在航线设置为强制实名，REALNAEMINFO 必须填写"),
    err_code01077("err_code01077","实名制中的姓名、证件号、证件类型为必填字段"),
    err_code01078("err_code01078","提票验证码 CARDNUM 为必填字段"),
    err_code01091("err_code01091","confirmXML 參數為空"),
    err_code01092("err_code01092","confirmXML 格式錯誤"),
    err_code01201("err_code01201","EMAIL 未填寫"),
    err_code01202("err_code01202","REFNO 未填寫"),
    err_code01203("err_code01203","ISETICKET 未填寫"),
    err_code01204("err_code01204","ADDRESS 未填寫"),
    err_code01205("err_code01205","SEATRANK_ID 未填寫"),
    err_code01206("err_code01206","PRICE 未填寫"),
    err_code01207("err_code01207","DETAILID 未填寫"),
    err_code01208("err_code01208","VOYAGEROUTEID 未填寫"),
    err_code01209("err_code01209","CLIENTTYPE 未填寫"),
    err_code01210("err_code01210","PASSENGER 未填寫"),
    err_code01211("err_code01211","PASSENGERID 未填寫"),
    err_code01212("err_code01212","PAYMENT 未填寫"),
    err_code01231("err_code01231","TRANSACTION_ID 未填寫"),
    err_code01251("err_code01251","TRANSACTION_ID 對應的臨時售票記錄不存在"),
    err_code01252("err_code01252","確認訂單失敗"),
    err_code01253("err_code01253","訂單確認成功，但返回 XML 失敗"),
    err_code01254("err_code01254","submit 支付方式為 2，傳入 payment 必須大於 0"),
    err_code01255("err_code01255","submit 支付方式為 1、3 或 5，傳入 payment 必須為 0"),
    err_code01256("err_code01256","支付方式未定義，submit 支付方式必須為 1,2,3,5"),
    err_code01257("err_code01257","IP 格式不正确"),
    err_code01258("err_code01258","网上支付失败"),
    err_code01259("err_code01259","submit 和 confirm 的工作点不一致"),
    err_code02000("err_code02000","交易号不存在"),
    err_code02001("err_code02001","验证码不存在"),
    err_code02002("err_code02002","无效的日期"),
    err_code02003("err_code02003","闸口不能为空"),
    err_code03001("err_code03001","ticketXml 參數為空"),
    err_code03002("err_code03002","输入的 Xml 參數為空"),
    err_code03003("err_code03003","按金币种不一致"),
    err_code03004("err_code03004","按金判断异常"),
    err_code03005("err_code03005","订票币种不一致"),
    err_code03006("err_code03006","订票价格不一致"),
    err_code03007("err_code03007","订票票类不一致"),
    err_code03008("err_code03008","当前工作点没有设置售卖该航段或者有票价变动或替班"),
    err_code03009("err_code03009","优惠类型票数限制判断异常"),
    err_code03010("err_code03010","该单交易的优惠类型票数大于设定的最大数值"),
    err_code03011("err_code03011","该单交易的优惠类型票数少于设定的最小数值"),
    err_code03012("err_code03012","优惠号码验证不通过"),
    err_code03013("err_code03013","优惠号码验证不通过,港口公司不存在"),
    err_code03014("err_code03014","实名制用户只能购买同一航班的一张船票(输入参数有重复航班)"),
    err_code03015("err_code03015","实名制用户只能购买同一航班的一张船票(该实名用户已经购买过某航班的船票)"),
    err_code03016("err_code03016","已预订过的实名制用户释放旧订单，更改订单状态失败"),
    err_code04001("err_code04001","BOOKINGTRANID 參數為空"),
    err_code04002("err_code04002","ORIGINTICKETCODE 參數為空"),
    err_code04003("err_code04003","改票的票数和原票数不一致"),
    err_code04004("err_code04004","船票号不存在"),
    err_code04005("err_code04005","已消票不允许改票"),
    err_code04006("err_code04006","已退票不允许改票"),
    err_code04007("err_code04007","已改票不允许改票"),
    err_code04008("err_code04008","已转航班不允许改票"),
    err_code04009("err_code04009","已检票不允许改票"),
    err_code04010("err_code04010","已提票不允许改票"),
    err_code04011("err_code04011","已过开航时间不允许改票"),
    err_code04012("err_code04012","改票时间超过系统设定时间(开航前 N 分钟)"),
    err_code04013("err_code04013","确认改票失败"),
    err_code04014("err_code04014","该交易号没有订单或已经确认"),
    err_code04015("err_code04015","需要改票的船票号重复"),
    err_code05001("err_code05001","获取闸口入闸时间失败"),
    err_code06001("err_code06001","获取楼层船类型关系失败"),
    err_code07001("err_code07001","未设置可售票类或未设置票价"),
    err_code09001("err_code09001","submitRnXml 格式错误"),
    err_code09002("err_code09002","保存或更新实名信息失败"),
//    err_code09002("err_code09002","实名制字段 IDTYPE、IDNUMBER、NAME 为必填"),
    err_code11000("err_code11000","TRANSACTIONID 參數為空"),
    err_code11001("err_code11001","IDTYPE 參數為空"),
    err_code11002("err_code11002","PASSPOR 參數為空"),
    err_code11003("err_code11003"," SURNAME 參數為空"),
    err_code11004("err_code11004"," FIRSTNAME 參數為空"),
    err_code11005("err_code11005"," AIRWAYS 參數為空"),
    err_code11006("err_code11006"," TICKETCODE 參數為空"),
    err_code99999("err_code99999","其它异常"),
    ;

    private String code;
    private String type;

    ShipErrorCodeEnum(String code, String type) {
        this.code = code;
        this.type = type;
    }

    public String getCode() {
        return code;
    }
    public String getType() {
        return type;
    }

    public static ShipErrorCodeEnum getDefined(String code){
        for (ShipErrorCodeEnum err : ShipErrorCodeEnum.values()) {
            if (err.code.equals(code)) {
                return err;
            }
        }
        return ShipErrorCodeEnum.err_code99999;
    }
}

